package com.example.app.components.MyButton

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.example.app.components.MyText.MyText
import com.example.app.ui.theme.my_description_color

@Composable
fun MyCancelButton(
    onClick: () -> Unit,
    enabled: Boolean = true,
    content: @Composable () -> Unit = {
        MyText(text = "取消")
    }
) {
    MyOutlinedButton(
        enabled = enabled,
        border = BorderStroke(
            3.dp,
            if (enabled) my_description_color else MaterialTheme.colorScheme.background
        ),
        colors = ButtonDefaults.outlinedButtonColors(
            contentColor = my_description_color,
            containerColor = MaterialTheme.colorScheme.surface,
        ),
        onClick = onClick
    ) {
        content()
    }
}